<template>
	<view class="hun" style="background-color: #EEEEEE;position: relative;height: 100%;">
		<view class="inv-h-w" v-if="optionsText==1">
			<view :class="['inv-h',Inv==0?'inv-h-se':'']" @click="unsubmit">详情</view>
			<view :class="['inv-h',Inv==1?'inv-h-se':'']" @click="submit">处理</view>
		</view>

		<view class="" :style="optionsText==1?'margin-top: 100upx':'margin-top: 0'"
			style="position: absolute;width: 100%;">
			<view class="formPage" v-show="Inv==0">
				<form>
					<view class="formPage-titel" v-if="optionsText==1">
						<view>
							质量工作在线沟通
						</view>
						<!-- <image v-if="basic==1" @click="downUp(1)" style="width:7%;height: 60%;"
							src="@/static/chevron-down.png" alt />
						<image v-if="basic==2" @click="downUp(2)" style="width:7%;height: 60%;"
							src="@/static/chevron-up.png" alt /> -->
					</view>
					<cLabel v-if="basic==1" title='涉及单位' v-model='totalData.fCheckunit' :must="newMust"
						:disabled="newDisabled" :dataText='totalData.fCheckunit' rightIcon='' mode='text'
						@focus="CheckunitFun(0)" />
					<cLabel v-if="basic==1" title='涉及项目' v-model='totalData.fCheckproject' :must="newMust"
						:disabled="newDisabled" :dataText='totalData.fCheckproject' rightIcon='' mode='text'
						@focus="CheckunitFun(1)" />
					<cLabel :flagNum="flagNum" v-if="basic==1" title='网格员类别' v-model='totalData.fGridmantype'
						:must="newMust" :disabled="newDisabled" :dataText='totalData.fGridmantype'
						:selectList="fGridmantypeList" :mode='selector' @input='GridmantypeFun' />

					<cLabel :flagNum="flagNum" v-if="basic==1" title='指定网格员' v-model='totalData.fSubgridmanname'
						:must="newMust" :disabled="newDisabled" placeholderText='请先填写涉及项目和网格员类别'
						:dataText='totalData.fSubgridmanname' @input='SubgridmanFun' :selectList="fSubgridmannameList"
						:mode='selector' />
					<cLabel v-if="basic==1" title='存在问题简述' v-model='totalData.fProblemdescription' :must="newMust"
						:disabled="newDisabled" :dataText='totalData.fProblemdescription' rightIcon=''
						mode='textarea' />
					<cLabel v-if="basic==1" title='发现问题日期' over="calc(5em + 15px)" v-model='totalData.fHasproblemdates'
						:must="newMust" :disabled="newDisabled" :dataText='totalData.fHasproblemdates' :mode='date1'
						:flagNum="flagNum" />
					<cLabel v-if="basic==1" title='填报人' v-model='totalData.fReportname' :must="newMust"
						:disabled="newDisabled" :dataText='totalData.fReportname' rightIcon='' mode='text' />
					<cLabel v-if="basic==1" title='填报日期' over="calc(5em + 15px)" v-model='totalData.fReportdates'
						:must="newMust" :disabled="newDisabled" :dataText='totalData.fReportdates' :mode='date1'
						:flagNum="flagNum" />
					<view v-if="basic==1" class="cu-bar bg-white" style="border-top:1px #ccc solid ;">
						<view class="action">
							<image :src="unIcon" mode="" style="width: 30upx;height: 30upx;vertical-align: middle;">
								相关现场资料
						</view>
						<view class="action">
							{{fileList.length}}/{{count}}
						</view>
					</view>

					<view class="cu-form-group">
						<view class="grid col-4 grid-square flex-sub">
							


							<view class="bg-img" v-for="(item,index) in fileList" :key="index" 
								>
								<image src="@/static/organization.png" mode="aspectFill"></image>
								<image v-if="item.fFileType=='.pdf'" @tap="pdfPage(item.name, item.url)"
									src="@/static/organization.png">
								</image>
								<view v-else style="height: 100%;" :data-url="item.url">
									<image style="height: 200upx;" :src="item.url"
										@tap="ViewImage1($event, item.url)"></image>
								</view>
								
								<view class="cu-tag bg-red" v-if="optionsText==0"
									@tap.stop="DelFile($event,item.fId,index)">
									<text class='cuIcon-close'></text>
								</view>
								<view class="fileText"> {{item.name}}</view>
							</view>
							<view v-if="(fileList.length<count)&&(optionsText==0)">
								<lsj-upload ref="lsjUpload" childId="upload" :width="heights" :height="heights"
									:option="option" :size="size" :debug="debug" :instantly="instantly"
									@progress="onprogress" @change="onChange" :count='count'>
									<view class="solids" style="width: 156rpx;height: 156rpx;">
										<text class='cuIcon-add'></text>
									</view>
									<!-- <view class="btn" :style="{height: height}">选择附件</view> -->
								</lsj-upload>
							</view>

						</view>
					</view>

					<view class="cu-form-group" style="margin-bottom: 50upx;">
					</view>

					<div class="wrapper" v-if="optionsText==0">

						<div class="list">
							<text class="text" @click="clickNum(0)">保存</text>
							<text class="text" @click="clickNum(1)">下发</text>

						</div>
					</div>
					<div class="wrapper" v-if="optionsText==1">
						<div class="list">
							<text class="text" @click="clickNum(2)">回复</text>
						</div>
					</div>
				</form>



			</view>

			<view class="formPage" v-show="Inv==1">
				<form>

					<view style="width: 100%;">
						<view class="formPage-titel">
							<view>
								问题处理情况
							</view>
							<!-- 	<image v-if="close==1" @click="downUpClose(1)" style="width:7%;height: 60%;"
								src="@/static/chevron-down.png" alt />
							<image v-if="close==2" @click="downUpClose(2)" style="width:7%;height: 60%;"
								src="@/static/chevron-up.png" alt /> -->
						</view>



						<cLabel v-if="close==1" title='处理结果' v-model='totalData.fCheckresult' must="must"
							:dataText='totalData.fCheckresult' :selectList="fCheckresultList" mode='selector2'
							@input='selectorFun' />

						<cLabel v-if="close==1" title='问题处理简述' v-model='totalData.fCheckdescription' must="must"
							:disabled="disabled" :dataText='totalData.fCheckdescription' rightIcon='' mode='textarea' />
						<cLabel v-if="close==1" title='网格员' v-model='totalData.fGridmanname' must="must"
							:disabled="true" :dataText='totalData.fGridmanname' rightIcon='' mode='text' />
						<cLabel v-if="close==1" title='完成日期' over="calc(5em + 15px)" :dataText='totalData.fCheckdates'
							must="must" :disabled="disabled" v-model='totalData.fCheckdates' mode='date1'
							:flagNum="flagNum" />
						<view v-if="close==1" class="cu-bar bg-white" style="border-top:1px #ccc solid ;">
							<view class="action">
								<image :src="optionsText==1?mustIcon:unIcon" mode=""
									style="width: 30upx;height: 30upx;vertical-align: middle;">
									处理过程相关资料
							</view>
							<view class="action">
								{{fRecheckfileList.length}}/{{count}}
							</view>
						</view>

						<view v-if="close==1&&optionsText==1" class="cu-form-group">
							<view class="grid col-4 grid-square flex-sub">



								<view class="bg-img" v-for="(item,index) in fRecheckfileList" :key="index"
									 >
									
									<image v-if="item.fFileType=='.pdf'" @tap="pdfPage(item.name, item.url)"
										src="@/static/organization.png">
									</image>
									<view v-else style="height: 100%;" :data-url="item.url">
										<image style="height: 200upx;" :src="item.url"
											@tap="ViewImage($event, item.url)"></image>
									</view>
									<view class="cu-tag bg-red"
										@tap.stop="DelFilefRecheckfileList($event,item.fId,index)">
										<text class='cuIcon-close'></text>
									</view>
									<view class="fileText"> {{item.name}}</view>
								</view>
								<view v-if="fRecheckfileList.length<count">
									<lsj-upload ref="lsjUpload" childId="upload" :width="heights" :height="heights"
										:option="option" :size="size" :debug="debug" :instantly="instantly"
										@progress="onprogressfRecheckfileList" @change="onChange" :count='count'>
										<view class="solids" style="width: 156rpx;height: 156rpx;">
											<text class='cuIcon-add'></text>
										</view>
										<!-- <view class="btn" :style="{height: height}">选择附件</view> -->
									</lsj-upload>
								</view>

							</view>
						</view>


					</view>

					<view class="cu-form-group" style="margin-bottom: 100upx;">
					</view>
					<div class="wrapper" v-if="optionsText==1">
						<div class="list">
							<text class="text" @click="clickNum(2)">回复</text>
						</div>
					</div>
				</form>
			</view>

			<loading :shadeShow="shadeShow" :shadeClick="false" :backgroundColor="backgroundColor" :width="width"
				:height="height" ref="loading" :custom="false" :type="1" @callback="callback()">
			</loading>
			<tki-tree ref="company" nodeKey="fCompanyid" rangeKey="fShortname" :selectParent="selectParent"
				:multiple="multiple" :range="companyTree" :foldAll="flod" @confirm="treeConfirm" @cancel="treeCancel">
			</tki-tree>
		</view>
	</view>
</template>
<script src="./index.js">
</script>
<style scoped lang="less">
	@import './index.less';
</style>
